package s2elinshu;

import java.util.Scanner;

public class J08SungJuk {
	public static void main(String[] args) {
		// 배열을 이용한 성적 산출

		// 변수선언
		Scanner sc = null;
		String name[] = new String[4];
		int kor[] = new int[4];
		int eng[] = new int[4];
		int mat[] = new int[4];
		int tot[] = new int[4];
		double avg[] = new double[4];
		char grd[] = new char[4];


		// 입력 및 성적 처리
		sc = new Scanner(System.in);
		String result = "";
        int n = 4;
        
		for(int i = 1; i<n;++i){
		System.out.println("이름은?");
		name[i] = sc.next();
		System.out.println("국어점수는?");
		kor[i] = sc.nextInt();       
		System.out.println("영어점수는?");
		eng[i] = sc.nextInt();		
		System.out.println("수학점수는?");
		mat[i] = sc.nextInt();  	
        }
		
       // 성적처리
        
		for(int j=1;j<n;++j){
		tot[j] = kor[j]+eng[j]+mat[j];
		avg[j] = (double)tot[j]/n;
		switch((int)avg[j]/10){
		case 10:
		case 9:
			grd[j] = '수';
			break;
		case 8:
			grd[j] = '우';
			break;
		case 7:
			grd[j] = '미';
			break;
		case 6:
			grd[j]  = '양';
			break;
		default:
			grd[j]  = '가';
		}
		}
     
				
		sc.close();

		// 결과출력
      for(int h=1;h<n;++h){
       result += name[h]+"\t"+kor[h]+"\t"+eng[h]+"\t"+mat[h]+"\t"+tot[h]+"\t"+avg[h]+"\t"+grd[h]+"\n";
      }
      System.out.println(result);

	} // main닫음

} // class닫음
